//
// Created by Yucheng on 6/2/17.
//

#include "modules/client.hpp"

BOOST_AUTO_TEST_SUITE( misc_httpclient )

BOOST_AUTO_TEST_CASE( simple )
{
    TestApp app;
    app.setup();

    std::string clientError = "";
    diylane::http::client::AcquiredWorker client(&client::Pool::singleton(), clientError);
    diylane::http::Request req;
    diylane::http::Response resp;
    req.url = "http://www.baidu.com";
    req.cookieJar.set(new diylane::http::Cookie("abc", "zzzzz"));
    req.cookieJar.set(new diylane::http::Cookie("PTOKEN", "A428DB28EAE41DF7BE9F34329B2D5238"));
    if (!client.unwrap()->doRequest(&req, resp)) {
        std::cout << "error: " << resp.error << std::endl;
    }
}

BOOST_AUTO_TEST_SUITE_END()
